package com.config;

import com.service.MCategoryService;
import com.service.MPostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
import org.springframework.web.context.ServletContextAware;

import javax.servlet.ServletContext;
@Component
public class ContextStartup implements ApplicationRunner, ServletContextAware {
    @Autowired
    MCategoryService categoryService;
    @Autowired
    MPostService postService;
    ServletContext servletContext;
    @Override
    public void run(ApplicationArguments args) throws Exception {
        postService.initWeekRank();
        System.out.println("?????");
    }

    @Override
    public void setServletContext(ServletContext servletContext) {
        this.servletContext=servletContext;
    }
}
